﻿<UserControl x:Class="QSHC.QSchedule.Silverlight.Views.AppointmentCard"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:converter="clr-namespace:QSHC.QSchedule.Silverlight.Converters"
    mc:Ignorable="d" FontFamily="Angsana New"  FontSize="13.333"
    Width="378" Height="550" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk">
    
    <UserControl.Resources>
        <converter:PhysicianToTextConverter x:Key="physicianToTextConverter" />
        <converter:AppointmentDateToTextConverter x:Key="appointmentDateToTextConverter" />
        <converter:PreOrderInstructionConverter x:Key="preOrderInstructionConverter"/>
        <converter:PreOrderAppointmentConverter x:Key="preOrderAppointmentConverter"/>
    </UserControl.Resources>
    
    <Grid x:Name="LayoutRoot" Background="White">
        <StackPanel>
            <TextBlock  FontSize="20" FontWeight="Bold" Text="ใบนัด" HorizontalAlignment="Center" />
            <Image Height="60" Name="image1" Stretch="Fill" Width="60" Margin="-290,0,0,0" />
            <TextBlock FontWeight="Bold" Text="ศูนย์หัวใจสิริกิติ์ภาคตะวันออกเฉียงเหนือมหาวิทยาลัยขอนแก่น" HorizontalAlignment="Center" Height="16" Width="283" TextWrapping="Wrap" Margin="90,-100,0,0" />
            <TextBlock FontWeight="Bold" Text="โทร" HorizontalAlignment="Center" Height="16" Width="283" TextWrapping="Wrap" Margin="90,-60,0,0" />
            <TextBlock FontWeight="Bold" Text="{Binding Appointment.Service.Phone}" HorizontalAlignment="Center" Height="16" Width="203" TextWrapping="Wrap" Margin="50,-60,0,0" />
            <Image Source="{Binding BarcodeImagePath}" HorizontalAlignment="Center" Width="100" Margin="0,0,0,0"/>
            <TextBlock    FontWeight="Bold" Text="{Binding Barcode}" HorizontalAlignment="Center" Margin="0,-5,0,0" />
            <StackPanel Margin="0,2,0,0" Orientation="Horizontal" HorizontalAlignment="Left">
                <TextBlock  FontSize="18" FontWeight="Bold" Text="ชื่อ :" HorizontalAlignment="Right" Width="85" TextAlignment="Right" />
                <TextBlock  FontSize="18" FontWeight="Normal" Margin="5,0,0,0" Text="{Binding Appointment.AppointedPatient.Title}" />
                <TextBlock  FontSize="18" FontWeight="Normal" Text="{Binding Appointment.AppointedPatient.FirstName}" />
                <TextBlock  FontSize="18" FontWeight="Normal" Margin="10,0,0,0" Text="{Binding Appointment.AppointedPatient.LastName}" />
                <TextBlock  FontSize="18" FontWeight="Bold" Text="HN :" HorizontalAlignment="Right" Width="40" TextAlignment="Right" />
                <TextBlock  FontSize="18" FontWeight="Normal" Margin="5,0,0,0" Text="{Binding Appointment.AppointedPatient.HN}" />
            </StackPanel>
            
            <StackPanel Margin="0,2,0,0" Orientation="Horizontal" HorizontalAlignment="Left">
                <TextBlock  FontSize="18" FontWeight="Bold" Text="แพทย์ผู้ตรวจ :" HorizontalAlignment="Right" Width="85" TextAlignment="Right" />
                <TextBlock  FontSize="18" FontWeight="Normal" Margin="5,0,0,0" Text="{Binding Converter={StaticResource physicianToTextConverter}, Path=Appointment.Physician}" />
            </StackPanel>
            <StackPanel Margin="0,2,0,0" Orientation="Horizontal" HorizontalAlignment="Left">
                <TextBlock  FontSize="18" FontWeight="Bold" Text="วันที่นัด :" HorizontalAlignment="Right" VerticalAlignment="Center" Width="85" TextAlignment="Right"/>
                <TextBlock  FontSize="18" FontWeight="Bold" Margin="5,0,0,0" VerticalAlignment="Center" Text="{Binding Converter={StaticResource appointmentDateToTextConverter}, Path=Appointment.AppointmentDate}"/>
                <TextBlock  FontSize="18" FontWeight="Bold" Text="เวลา" HorizontalAlignment="Right" VerticalAlignment="Center" Width="40" TextAlignment="Right"/>
                <TextBlock  FontSize="18" FontWeight="Bold" Margin="10,0,0,0" VerticalAlignment="Center" Text="{Binding Appointment.AppointmentTime}"/>
                <TextBlock  FontSize="18" FontWeight="Bold" Text="น." HorizontalAlignment="Right" VerticalAlignment="Center" Width="15" TextAlignment="Right"/>
            </StackPanel>
            <StackPanel Margin="0,2,0,0" Orientation="Horizontal" HorizontalAlignment="Left">
                <TextBlock  FontSize="14" FontWeight="Bold" Text="นัดมาเพื่อ :" Width="85" TextAlignment="Right"/>
                <TextBlock x:Name="AppointmentDetailsTextBlock"     FontWeight="Bold" Text="{Binding Path=Appointment, Converter={StaticResource preOrderAppointmentConverter}}" />
            </StackPanel>
            <StackPanel Margin="0,2,0,0" Orientation="Horizontal" HorizontalAlignment="Left">
                <TextBlock   FontSize="14" FontWeight="Bold" Text="คำแนะนำ/เตรียมตัว :" Width="85" TextAlignment="Right"/>
                <TextBlock x:Name="SuggestionDetailsTextBlock"    FontWeight="Bold"   Text="{Binding Path=Appointment, Converter={StaticResource preOrderInstructionConverter}}" />
                
            </StackPanel>
            <StackPanel Margin="0,2,0,0" Orientation="Horizontal" HorizontalAlignment="Left">
                <TextBlock   FontSize="14" FontWeight="Bold" Text="เพิ่มเติม :" Width="85" TextAlignment="Right"/>
                <TextBlock x:Name="RemarkTextBlock" Margin="5,0,0,0"    FontWeight="Normal" Text="{Binding Appointment.Remark}" TextWrapping="Wrap" />

            </StackPanel>
            
            <TextBlock Text="หมายเหตุ: 1.งดให้บริการผู้ป่วยนอกในวันหยุดนักขัตฤกษ์"     FontWeight="Bold" />
            <TextBlock Text="2.กรุณาเก็บรักษาใบนัดและนำใบนัดมารับบัตรคิวในวันที่นัดทุกครั้ง"     FontWeight="Bold" Margin="40,0,0,0" />
            <TextBlock Text="3.กรุณาปิดโทรศัพท์มือถือก่อนเข้าห้องตรวจ"     FontWeight="Bold" Margin="40,0,0,0" />
            
            <StackPanel Orientation="Horizontal">
                <TextBlock Width="60" Height="20" Margin="150,0,0,0" Text="ผู้ออกใบนัด :" TextAlignment="Right" />
                <TextBlock Height="20" Text="{Binding Path=EmployeeName}"    />
                
            </StackPanel>
            <StackPanel Orientation="Horizontal">
                <TextBlock Width="60" Height="20" Margin="150,0,0,0" Text="หน่วยงาน :" TextAlignment="Right" />
                <TextBlock Height="20" Margin="0,0,0,0" Text="{Binding Path=DivisionName}"    />
                
            </StackPanel>
            
        </StackPanel>
    </Grid>
</UserControl>
